/*
 * xAPBSCstate.java
 *
 * Java class used to manage xAP BSC state information
 *
 * Copyright (c) 2009 Daniel Berenguer <dberenguer@usapiens.com>
 *
 * This file is part of the canTracer project.
 *
 * OPNODE is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * OPNODE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with canTracer; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * 11/10/09 by Daniel Berenguer : first version
 */

package xAP;


/********************************************************************************************
* xAPBSCstate
*
* xAP BSC text class
*
********************************************************************************************/
public class xAPBSCstate
{
    // Member variables
    private String strState;

   /********************************************************************************************
    * xAPBSCstate
    *
    * xAP BSC state constructor
    *
    * 'State'    xAP BSC state string
    *
    ********************************************************************************************/
    public xAPBSCstate(String State)
    {
        strState = State;
    }
   /********************************************************************************************
    * xAPBSCstate
    *
    * xAP BSC state constructor
    *
    * 'State'    xAP bSC state bool
    *
    ********************************************************************************************/
    public xAPBSCstate(boolean State)
    {
        if (State)
            strState = "ON";
        else
            strState = "OFF";            
    }
   /********************************************************************************************
    * toBool
    *
    * Convert BSC state into boolean value
    *
    * Returns:
    *   true -> ON state
    *   false -> OFF value
    ********************************************************************************************/
    public boolean toBool()
    {
        if (strState.equalsIgnoreCase("on"))
            return true;
        else
            return false;
    }

   /********************************************************************************************
    * toString
    *
    * Convert BSC state into a string
    *
    ********************************************************************************************/
    public String toString()
    {
        return strState;
    }
}

